<template>
  <view class="my-search-container" :style="{'background-color': bgColor}">
    <view class="my-search-box" @click="searchBoxHandler" :style="{'border-radius':radius + 'px'}">
      <uni-icons type="search" size="17" ></uni-icons>
      <text class="placeholder">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    data() {
      return {
        
      };
    },
    props:{
      // 自定义背景颜色
      bgColor: {
        default: '#55aaff',
        type: String
      },
      // 自定义圆角角度
      radius: {
        default: 25,
        type: Number
      }
    },
    methods: {
      searchBoxHandler(){
        this.$emit('click')
      }
    }
  }
</script>

<style lang="scss">
.my-search-container{
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 10px;
  .my-search-box{
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #ffffff;
    height: 36px;
    width: 100%;
    .placeholder{
      font-size: 15px;
      margin-left: 3px;
    }
  }
}
</style>